<?php

class Base{
	
    function get_type($ext){
		
		$file_type = array(
			'media'=>array('mp3','swf','mp4','avi','m3u8'),
			'doc'=>array('txt','doc','docx','csv','xls','ppt','htm','html','pdf',),
			'image'=>array('jpg','png','gif','bmp','jpeg'),
		);
		
		foreach($file_type as $key=>$val){
			if(in_array($ext,$val)){
				return $key;
			}
		}
		return 'other';
	}
}
